﻿@using System.Net;
@{
    var cultureItems = SupportedCultures.Cultures
        .Select(c => new { Value = c.TwoLetterISOLanguageName.ToLower(), Text = c.NativeName.Split(" ").FirstOrDefault() })
        .ToList();

    var selectList = new SelectList(cultureItems, "Value", "Text", CurrentLanguage);

}

<style>
    .dropbtn {
        background-color: transparent;
        /*color: white;*/
        /*padding: 16px;*/
        /*font-size: 16px;*/
        border: none;
        cursor: pointer;
    }

    .dropdown {
        position: relative;
        display: inline-block;
    }

    .dropdown-content {
        display: none;
        position: absolute;
        /*background-color: #f9f9f9;*/
        min-width: 100px;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        z-index: 1;
    }

        .dropdown-content a {
            /*color: black;*/
            padding: 8px 8px;
            text-decoration: none;
            display: block;
        }

            .dropdown-content a:hover {
                /*background-color: #3f51b5;*/
            }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown:hover .dropbtn {
        /*background-color: #3f51b5;*/
    }
</style>

<label for="exampleInputName2">@_T["Language"]</label>
<div class="dropdown">
    <button class="dropbtn">@CurrentLanguageText<span class="glyphicon glyphicon-triangle-bottom"></span> </button>
    <div class="dropdown-content">
        @foreach (var item in cultureItems)
        {
            <a href="/Home/SetLanguage/?culture=@item.Value&returnUrl=@WebUtility.UrlEncode(PageUrl)">@item.Text</a>
        }
    </div>
</div>
<span>|</span>